import time

setGlobalDuration(10)

oscReceive(bus='pit', address='/pit', port=9000)
sine(pitch=1, pitchVar='pit')

startCsound()

li = line(start=250, destination=[1000,250], duration=5)
li.start()
li.play()

for i in range(1000):
    val = li.getValue()
    sendOscControl(value=val, address='/pit', port=9000)
    time.sleep(.01)
